//
//  DetailsHeadView.m
//  212--Homework  QQy音乐  阿里星球
//
//  Created by li cheng on 16/8/15.
//  Copyright © 2016年 冀永金. All rights reserved.
//

#import "DetailsHeadView.h"

@interface DetailsHeadView()
@property (nonatomic, strong) UIImageView *backGroundImageView;
@property (nonatomic, strong) UIImageView *smallImageView;
@end
@implementation DetailsHeadView
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        _backGroundImageView = [[UIImageView alloc] init];
        _backGroundImageView.backgroundColor = [UIColor purpleColor];
        [self addSubview:_backGroundImageView];
        _smallImageView = [[UIImageView alloc] init];
        _smallImageView.backgroundColor = [UIColor orangeColor];
        [self addSubview:_smallImageView];
        
    }
    return self;
}
- (void)layoutSubviews{
    [super layoutSubviews];
    _backGroundImageView.frame = self.bounds;
    CGFloat height = self.bounds.size.height / 5;
    CGFloat width = height;
    CGFloat x = 10;
    CGFloat y = self.bounds.size.height * 4 / 5 - 10;
    _smallImageView.frame = CGRectMake(x, y, width, height);
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
